import { createApp } from 'vue'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
import router from './router'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';
// 引入icon
import './assets/icon/iconfont.css'

import mitt from 'mitt'

import { library } from '@fortawesome/fontawesome-svg-core'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
import {
    faHome,
    faCogs,
    faWallet,
    faComment,
    faUser,
    faUserMd,
    faUserTag,
    faMobileAlt,
    faChartBar,
    faChartLine,
    faLock,
    faCommentDots,
    faBars,
    faComments,
    faClock,
    faMale,
    faCalendarAlt,
    faLightbulb,
    faArrowCircleUp,
    faArrowCircleDown,
    faGrin,
    faFileAlt,
    faBolt,
    faSearch,
    faMicrochip,
    faLink,
    faUnlink,
    faCheckCircle,
    faCheck,
    faChartPie,
    faTachometerAlt,
    faTools,
    faTrash,
    faCircle,
    faPlusCircle,
    faEdit,
    faPencilAlt,
    faIdCard, faSignOutAlt, faBan, faPlus, faMemory, faSyncAlt, faLungs, faEarDeaf, faWalking
} from "@fortawesome/free-solid-svg-icons";
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
library.add(faHome,faCogs,faWallet,faComment,faUser,faUserMd,faUserTag,faMobileAlt,faChartLine
    ,faLock,faCommentDots,faBars,faComments,faClock,faMale,faCalendarAlt,faBan,faPlus,faMemory,faSyncAlt
    ,faLightbulb,faArrowCircleUp,faArrowCircleDown,faGrin,faFileAlt,faBolt,faSearch,faMicrochip,faIdCard,faSignOutAlt
    ,faLink,faUnlink,faCheckCircle,faCheck,faChartBar,faChartPie,faTachometerAlt,faTools,faTrash,faPlusCircle,faEdit,faPencilAlt,faLungs,faEarDeaf,faWalking)
import { far } from '@fortawesome/free-regular-svg-icons'
import { fas } from '@fortawesome/free-solid-svg-icons'
// 添加实心图标
library.add(fas)
// 添加空心图标
library.add(far)
import Axios from '@/utils/axios.js';
const app = createApp(App)
const bus = mitt()
const pinia = createPinia();
pinia.use(piniaPluginPersistedstate);
app.config.globalProperties.$bus = bus //相当于Vue2中的:Vue.prototype.$bus = bus
app.use(pinia)
app.use(router)
app.use(ElementPlus, {
    locale: zhCn,
})
app.config.globalProperties.Axios = Axios;
app.mount('#app')
